#!/usr/bin/env python
# -*- coding: gb2312 -*-


import time,sys

d_0 = (2007,3,11,13,55,00,0,0,0)
d_0s = time.mktime(d_0)

_s = "\x1b\x5b"
while True:
    try:
        print 'counting    since        %s            to        %s   ~~~~~~~~~~~~~~~~~' % (time.ctime(d_0s),time.asctime())
        sec = time.mktime(time.localtime()) - d_0s
        hour = sec % (60*60*24)
        mins = hour % (3600)
        secs = mins % 60
        print '%10.1f' % (sec) , ' secsonds had passed by, which is'
        print '%10d' % (sec/60), ' minutes, which is'
        print '%10d' % ((sec)/60/60), ' hours, which is'
        print '%5d days  (%2d weeks plus %2d days) %3d hours %2d mins %2d secs' %(sec/60/60/24, sec/60/60/24/7, (sec/60/60/24 % 7), hour/60/60, mins/60, secs)
        sys.stdout.write(_s+"%dA"%(5))
        time.sleep(0.1)
    except KeyboardInterrupt:
        for i in range(5):
            print ""
        sys.exit(1)


